// Copyright (c) 2011 Blue Onion Software, All rights reserved
using System;
using System.Diagnostics.CodeAnalysis;
using BlueOnionSoftware.Bloget;
using NUnit.Framework;

namespace BlogetTests
{
    [TestFixture]
    [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
    public class TimeInformationTests
    {
        [Test]
        public void ToLocalTime()
        {
            var now = DateTime.UtcNow;
            Assert.AreEqual(now.AddHours(12), Time.LocalTime(12, now));
        }

        [Test]
        [ExpectedException(typeof (ArgumentOutOfRangeException))]
        public void ToLocalTimePositiveRangeCheck()
        {
            Time.LocalTime(15, DateTime.UtcNow);
        }

        [Test]
        [ExpectedException(typeof (ArgumentOutOfRangeException))]
        public void ToLocalTimeNegativeRangeCheck()
        {
            Time.LocalTime(-13, DateTime.UtcNow);
        }

        [Test]
        public void TimeRange()
        {
            var times = Time.TimeOffsets();
            Assert.AreEqual(25, times.Length);
        }
    }
}